# 使用NVIDIA CUDA基础镜像
FROM nvidia/cuda:11.8-runtime-ubuntu22.04

# 设置工作目录
WORKDIR /app

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    ffmpeg \
    wget \
    && rm -rf /var/lib/apt/lists/*

# 复制requirements.txt并安装Python依赖
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# 复制项目文件
COPY . .

# 暴露端口
EXPOSE 5001

# 启动命令
CMD ["uvicorn", "fastapi_app:app", "--host", "0.0.0.0", "--port", "5001", "--workers", "1"] 